<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>属性选择器</title>
    <script src="js/jquery-1.12.4.js"></script>
   <style type="text/css">
     #box {background-color:#FFF; border:2px solid red; padding:5px;}
    </style>
</head>
<body>
    <div id="box">
        <h2 class="odds" title="cartoonlist">游戏列表</h2>
        <ul>
            <li class="odds" title="kn_jp">荒野行动</li>
            <li class="evens" title="hy_jp">绝地求生</li>
            <li class="odds" title="ss_jp">王者荣耀</li>
        </ul>
    </div>
    <script type="text/javascript">
        $(document).ready(function() {
             $("h2").click(function(){
                //   $("h2[title]").css("background-color","#ccc");
                // $("[class=odds]").css("background-color","#ccc");
                // $("[id!=box]").css("background-color","#ccc");
                // $("[title^=h]").css("background-color","#ccc");
                // $("[title$=jp]").css("background-color","#ccc");
                // $("[title*=s]").css("background-color","#ccc");
                $("li[class][title*=y]").css("background-color","#ccc");
             })
        });
        </script>
        
</body>
</html>